using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class LoginByCodePage : System.Web.UI.Page
{
    Login login;
    protected void Page_Load(object sender, EventArgs e)
    {
        login = new Login();
        login.DisplayRememberMe=true;
        login.DestinationPageUrl="Login.Page.aspx";
        login.InstructionText=
        "Please enter your own username and password";
        login.TitleText="RecruitVietnam.com Login";
        login.Authenticate += new AuthenticateEventHandler(login_Authenticate);
        this.form1.Controls.Add(login);
    }

    void login_Authenticate(object sender, AuthenticateEventArgs e)
    {
        if (login.UserName == "abc@huukhang.com")
        {
            Response.Redirect("Default.aspx");
        }
        else
            login.FailureText = "Oh, Sai roi a nha.";
    }
}
